<template>
	<div class="zxmyContent">
        <!--头部-->
		<!--<header class="aui-bar aui-bar-nav aui-bar-light">
			<div class="go-back" @click="goBack">
				<i></i>
				<i></i>
				<i></i>
			</div>
			<div class="aui-title">商品信息</div>
		</header>-->
		<my-header :title="'商品信息'" :hasTitle="true" :hasBack="true" v-if="!confirmOrderFoods"></my-header>
		<my-header :title="'商品信息'"  :hasBack="true" :goBack="goBack" :canteen ="true" v-if="confirmOrderFoods"></my-header>
		<!--<div style="height:2rem;"></div>-->
		<div style="flex:1;overflow-y:auto;overflow-x: hidden;">
			<!--商品列表-->
			<!-- <div style="width: 100%;height: 1500px;background: red;">
				<div style="width: 100%;height: 300px;background: yellow;"></div>
				<div style="width: 100%;height: 300px;background: green;"></div>
				<div style="width: 100%;height: 300px;background: blue;"></div>
				<div style="width: 100%;height: 300px;background: black;"></div>
				<div style="width: 100%;height: 300px;background: pink;"></div>
			</div> -->
			<!-- <div class="aui-content"> 导致滑动卡顿故注释 -->
				<ul class="aui-list aui-media-list commodity_list subtotal_list" v-if="dataList && dataList[0] && dataList[0].length && !confirmOrderFoods">
					<li class="aui-list-item baoguo-title">
						<div class="aui-list-item-inner" style="text-align: left;">
							<span>{{'包裹1'}}</span>&nbsp;&nbsp;
							<span style="color: #ef5432;" v-if="getDateNormal && getOrderFlag">{{getSendTime(0)}}&nbsp;送达</span>
							<div class="aui-pull-right text_c_gray" >共<span>{{goodsNum(dataList[0])}}</span>件</div>
						</div>
					</li>
					<li class="aui-list-item baoguo-list-item baoguo-root" v-for="(item,index) in dataList[0]" :key='index'>
						<div class="aui-media-list-item-inner">
							<div class="aui-list-item-media" style="width:4.3125rem;min-height:4.3125rem ">
								<div class="goodsTopShow" v-if="item.buyType == 2 || item.buyType == 3" :class="{goodsTopShowBackY:item.buyType == 2,goodsTopShowBackR:item.buyType == 3}">
                                    {{item.buyType == 2?'加价购':'赠品'}}
                                </div>
								<img v-lazy="item.goodsImg || goodsImg(item) || 'static/image/demo2.png'" alt="" />

							</div>
							<div class="aui-list-item-inner suggest" style="text-align: left;min-height: 5.3125rem;width:56%;" v-if="item.buyType != 4">
								<h3 :style="item.workingInfo?'margin-bottom: 0.3rem;':'margin-bottom: 0.75rem;'">{{item.goodsname || item.goodsName}}</h3>
								<p v-if="item.workingInfo" class="hzhs">加工服务：{{getAdd(item)}}</p>
								<p style="min-height:1rem;">{{getGoodsspec(item)}}</p>
								<p style="position:absolute;bottom:0;left:0.5rem;">
									¥{{getSingerPricely(item)}}&nbsp;<del style="color:#6b6b6b;" v-if="comparePrice(item) == 1" >{{(Number(item.normalprice)).toFixed(2)}}</del>
									<span style="color: #000000;" v-if="item.mallUnit &&(item.goodsType == 6 || item.goodsType == 7)">/500g</span>
									<span style="color: #000000;" v-else>/{{item.mallUnit?item.mallUnit:''}}</span>
								</p>
							</div>
							<div class="subtotal" style="width: 38%;height:5.3125rem;" v-if="item.buyType != 4">
								<!-- <a style=" display: block;" v-if="compareMoney(item)">¥{{getSingerPrices(item)}}</a>
								<span style="display: inline-block;text-decoration:line-through;height:2.8rem;color: #ccc;font-size:0.5rem;"  v-if="compareMoney(item)">¥{{getSingerPrice(item)}}</span>
								<span style="display: inline-block;height:2.8rem;"  v-if="compareMoneys(item)">¥{{getSingerPrice(item)}}</span> -->
								<a style=" display: block;" >¥{{getSingerPrices(item)}}</a>
								<span v-if="compareMoney(item) == 1"
								 style="display: inline-block;text-decoration:line-through;height:2.8rem;color: #6b6b6b;font-size:0.5rem;" >¥{{getSingerPrice(item)}}</span>
								<!-- <span style="display: inline-block;height:2.8rem;" >¥{{getSingerPrice(item)}}</span> -->
								<p style="position:absolute;bottom:0;right:0.5rem;"><span v-if="item.goodsType != 7" style="display: inline-block;height:0;">x{{getGoodsSinger(item)}}</span><span v-if="item.goodsType == 7" style="display: inline-block;height:0;">{{getGoodsSinger(item)*1000}}g</span></p>
							</div>
							<div class="aui-list-item-inner suggest" style="text-align: left;min-height: 5.3125rem;"  v-if="item.buyType == 4">
								<h3 :style="item.workingInfo?'margin-bottom: 0.4rem;':'margin-bottom: 1rem;'">{{ item.goodsname || item.goodsName }}</h3>
								<p v-if="item.workingInfo" class="hzhs">加工服务：{{getAdd(item)}}</p>
								<p>{{getGoodsspec(item)}}</p>
								<p style="position:absolute;bottom:0;left:0.5rem;">{{getSingerPricelys(item)}}</p>
							</div>
							<div class="subtotal" style="width: 38%;height:5.3125rem;" v-if="item.buyType == 4">
								<a style=" display: block;">{{Number(item.integralprice)*Number(item.goodsNum)}}积分</a>
								<span style="display: inline-block;text-decoration:line-through;height:2.8rem;color: #6b6b6b;font-size:0.5rem;"></span>
								<p style="position: absolute;right: .5rem; bottom: 0;"><span v-if="item.goodsType != 7" style="display: inline-block;height:0;">x{{getGoodsSinger(item)}}</span>  <span v-if="item.goodsType == 7" style="display: inline-block;">{{getGoodsSinger(item)*1000}}g</span></p>
							</div>
						</div>
					</li>
				</ul>
				<ul class="aui-list aui-media-list commodity_list subtotal_list" v-if="dataList && dataList[1] && dataList[1].length && !confirmOrderFoods">
					<li class="aui-list-item baoguo-title">
						<div class="aui-list-item-inner" style="text-align: left;">
							<span >{{flag?'包裹2':'包裹1'}}</span>&nbsp;&nbsp;
							<span style="color: #ef5432;" v-if="getDateBig && getOrderFlag">{{getSendTime(1)}}&nbsp;送达</span>
							<div class="aui-pull-right text_c_gray" >共<span>{{goodsNum(dataList[1])}}</span>件</div>
						</div>
					</li>
					<li class="aui-list-item baoguo-list-item baoguo-root" v-for="(item,index) in dataList[1]" :key="index">
						<div class="aui-media-list-item-inner">
							<div class="aui-list-item-media" style="width:4.3125rem;height:4.3125rem ">
                                <div class="goodsTopShow" v-if="item.buyType == 2 || item.buyType == 3" :class="{goodsTopShowBackY:item.buyType == 2,goodsTopShowBackR:item.buyType == 3}">
                                    {{item.buyType == 2?'加价购':'赠品'}}
                                </div>
								<img v-lazy="item.goodsImg || goodsImg(item)  || 'static/image/demo2.png'" alt="" />
							</div>
							<div class="aui-list-item-inner suggest" style="text-align: left;min-height: 5.3125rem;" v-if="item.buyType != 4">
								<h3 :style="item.workingInfo?'margin-bottom: 0.4rem;':'margin-bottom: 1rem;'">{{ item.goodsname || item.goodsName }}</h3>
								<p v-if="item.workingInfo" class="hzhs">加工服务：{{getAdd(item)}}</p>
								<p>{{getGoodsspec(item)}}</p>
								<p style="position:absolute;bottom:0;left:0.5rem;">
								<!--<p>-->
									¥{{getSingerPricely(item)}}&nbsp;<del style="color:#6b6b6b;" v-if="comparePrice(item) == 1">{{(Number(item.normalprice)).toFixed(2)}}</del>
									<span style="color: #000000;" v-if="item.mallUnit &&(item.goodsType == 6 || item.goodsType == 7)">/500g</span>
									<span style="color: #000000;" v-else>/{{item.mallUnit?item.mallUnit:''}}</span>
								</p>
							</div>
							<div class="subtotal" style="width: 38%;height:5.3125rem;" v-if="item.buyType != 4">
								<!-- <a style=" display: block;" v-if="compareMoney(item)">¥{{getSingerPrices(item)}}</a>
								<span style="display: inline-block;text-decoration:line-through;height:2.8rem;color: #ccc;font-size:0.5rem;"  v-if="compareMoney(item)">¥{{getSingerPrice(item)}}</span>
								<span style="display: inline-block;height:2.8rem;"  v-if="compareMoneys(item)">¥{{getSingerPrice(item)}}</span> -->
								<a style=" display: block;">¥{{getSingerPrices(item)}}</a>
								<span style="display: inline-block;text-decoration:line-through;height:2.8rem;color: #6b6b6b;font-size:0.5rem;"
								v-if="compareMoney(item) == 1" >¥{{getSingerPrice(item)}}</span>
								<!-- <span style="display: inline-block;height:2.8rem;"  v-if="compareMoneys(item)">¥{{getSingerPrice(item)}}</span> -->
								<!--<p style="position: absolute;right: .5rem; bottom: 0;"><span v-if="item.goodsType != 7" style="display: inline-block;height:0;">x{{getGoodsSinger(item)}}</span>  <span v-if="item.goodsType == 7" style="display: inline-block;">{{getGoodsSinger(item)}}kg</span></p>-->
								<p><span v-if="item.goodsType != 7" style="display: inline-block;height:0;">x{{getGoodsSinger(item)}}</span>  <span v-if="item.goodsType == 7" style="display: inline-block;">{{getGoodsSinger(item)}}kg</span></p>
							</div>
							<div class="aui-list-item-inner suggest" style="text-align: left;min-height: 5.3125rem;"  v-if="item.buyType == 4">
								<h3 :style="item.workingInfo?'margin-bottom: 0.4rem;':'margin-bottom: 1rem;'">{{ item.goodsname || item.goodsName }}</h3>
								<p v-if="item.workingInfo" class="hzhs">加工服务：{{getAdd(item)}}</p>
								<p>{{getGoodsspec(item)}}</p>
								<p style="position:absolute;bottom:0;left:0.5rem;">{{getSingerPricelys(item)}}</p>
							</div>
							<div class="subtotal" style="width: 38%;height:5.3125rem;" v-if="item.buyType == 4">
								<a style=" display: block;">{{Number(item.integralprice)*Number(item.goodsNum)}}积分</a>
								<span style="display: inline-block;text-decoration:line-through;height:2.8rem;color: #6b6b6b;font-size:0.5rem;"></span>
								<p><span v-if="item.goodsType != 7" style="height:0;display: inline-block;">x{{getGoodsSinger(item)}}</span>  <span v-if="item.goodsType == 7" style="display: inline-block;">{{getGoodsSinger(item)}}kg</span></p>
								<!--<p style="position: absolute;right: .5rem; bottom: 0;"><span v-if="item.goodsType != 7" style="height:0;display: inline-block;">x{{getGoodsSinger(item)}}</span>  <span v-if="item.goodsType == 7" style="display: inline-block;">{{getGoodsSinger(item)}}kg</span></p>-->
							</div>
						</div>
					</li>
				</ul>
			<!-- </div> -->
			<!-- 堂食订单的商品信息展示页面 -->
				<ul class="aui-list aui-media-list commodity_list subtotal_list" v-if="foodShopInformation && confirmOrderFoods" v-for="(item,index) in foodShopInformation" :key='index'>
					<li class="aui-list-item baoguo-title">
						<div class="aui-list-item-inner" style="text-align: left;">
							<span>{{'档口：'}}</span>&nbsp;&nbsp;
                            <span>{{item.stallName}}</span>
							<!-- <span style="border:1px solid rgb(239, 84, 35);color:rgb(239, 84, 35);background:#ffffff;margin-left:0.4rem;">档口当前排队人数：{{"??"}}</span> -->
							<div class="aui-pull-right text_c_gray" >共<span>{{item.orderGoodsList.length}}</span>件</div>
						</div>
					</li>
					<li class="aui-list-item baoguo-list-item baoguo-root" v-for="(list,indexs) in item.orderGoodsList" :key='indexs' >
						<div class="aui-media-list-item-inner">
							<div class="aui-list-item-media" style="width:4.3125rem;height:4.3125rem ">
								<div class="goodsTopShow" v-if="list.buyType == 2 || list.buyType == 3" :class="{goodsTopShowBackY:list.buyType == 2,goodsTopShowBackR:list.buyType == 3}">
                                    {{list.buyType == 2?'加价购':'赠品'}}
                                </div>
								<img v-lazy="list.goodsImg || goodsImg(list) || 'static/image/demo2.png'" alt="" />

							</div>
							<div class="aui-list-item-inner suggest" style="text-align: left;min-height: 5.3125rem;width:56%;" >
								<h3 >{{list.goodsname || list.goodsName}}</h3>
								<p v-if="list.workingInfo" class="hzh">加工服务：{{getAdd(list)}}</p>
								<!-- <p style="min-height:1rem;">{{getGoodsspec(list)}}</p> -->
								<p v-if="list.goodsSpec">规格：{{list.goodsSpec}}</p>
								<p >单价：¥{{getSingerPricely(list)}}&nbsp;
									<del style="color:#6b6b6b;" v-if="comparePrice(list) == 1" >{{(Number(list.normalprice)).toFixed(2)}}</del>
									<span style="color: #000000;" v-if="list.mallUnit &&(list.goodsType == 6 || list.goodsType == 7)">/500g</span>
									<span style="color: #000000;" v-else>/{{list.mallUnit?list.mallUnit:''}}</span>
								</p>
								<p >数量：{{list.goodsNum}}</p>
							</div>
							<div class="subtotal" style="width: 38%;height:5.3125rem;">
								<!-- <a style=" display: block;" v-if="compareMoneyFood(list)">¥{{getSingerPricesFood(list)}}</a> -->
								<!-- <span style="display: inline-block;text-decoration:line-through;height:2.8rem;color: #ccc;font-size:0.5rem;"  v-if="compareMoneyFood(list)">¥{{getSingerPriceFood(list)}}</span> -->
								<!-- <span style="display: inline-block;height:2.8rem;"  v-if="compareMoneysFood(list)">¥{{getSingerPriceFood(list)}}</span> -->
								<a style=" display: block;">¥{{getSingerPrices(list)}}</a>
								<span style="display: inline-block;text-decoration:line-through;height:2.8rem;color: #6b6b6b;font-size:0.5rem;"
								v-if="compareMoney(list) == 1" >¥{{getSingerPrice(list)}}</span>
								<!-- <span style="display: inline-block;height:2.8rem;"  v-if="compareMoneysFood(list)">¥{{getSingerPriceFood(list)}}</span> -->
								<!-- <p style="position:absolute;bottom:0;right:0.5rem;"><span v-if="list.goodsType != 7" style="display: inline-block;height:0;">x{{getGoodsSinger(list)}}</span><span v-if="list.goodsType == 7" style="display: inline-block;height:0;">{{getGoodsSinger(list)}}kg</span></p> -->
							</div>
						
						</div>
					</li>
				</ul>
			<!--商品列表 end-->
			
		</div>
	</div>

</template>

<script>

import {mapGetters,mapMutations} from "vuex";
import Header from "../header";
import axios from "axios";
	export default {
	  	name: 'hello',
	  	data () {
	    	return {
				msg: '这是新增地址页面',
	            page: "CommodityInformation",
	            componentName: "CommodityInformation",
	            dataList: [],
	            num:null,
	            type:'',
				flag:false, // 是否同时存在大家爱你和常规商品两个包裹
				confirmOrderFoods:null,//判断是否是堂食订单的商品信息
			}
		},
		computed: {
			...mapGetters('zx',[
				"getDateNormal","getDateBig","getTimeNormal","getTimeBig","getOrderFlag"
			]),
			foodShopInformation(){
				return this.$store.state.hzh.shopInformation
				// return this.$store.state.hzh.BillContent;
			}
		},
		components: {
	       "my-header": Header
	    },
	    methods: {
	    	//获取配送时间用于展示
	    	getSendTime(num){
	    		var str = '';
	    		var getTimeNormal = this.getTimeNormal;
	    		var getTimeBig = this.getTimeBig;
	    		//0 代表常规的包裹  1 代表大件的包裹
	    		if(num === 0){
	    			if(this.dataList && this.dataList[0] && this.dataList[0].length){
	    				var sendDate = this.getDateNormal;
	    				var startBookTm = this.getTime(getTimeNormal.startBookTm);
	    				var endBookTm = this.getTime(getTimeNormal.endBookTm);
	    				console.log(sendDate,startBookTm,endBookTm)
	    				str = sendDate + " " + startBookTm + "-" + endBookTm;
	    			}

	    		}else if(num === 1){
	    			if(this.dataList && this.dataList[1] && this.dataList[1].length){
	    				var sendDate = this.getDateBig;
	    				var startBookTm = this.getTime(getTimeBig.startBookTm);
	    				var endBookTm = this.getTime(getTimeBig.endBookTm);
	    				str = sendDate + " " + startBookTm + "-" + endBookTm;
	    				console.log(sendDate,startBookTm,endBookTm)
	    			}
	    		}
	    		return str;
	    	},
	    	//转换时间格式
			getTime(param) {

				if(param) {
					let date = new Date(param);
					let year = date.getFullYear();
					let month = checkTime(date.getMonth() + 1);
					let day = checkTime(date.getDate());
					let hour = checkTime(date.getHours());
					let min = checkTime(date.getMinutes());
					let sec = checkTime(date.getSeconds());

					function checkTime(i) {
						if(i < 10) {
							i = '0' + i;
						}
						return i;
					}

					return hour + ':' + min;
				} else {
					return '';
				}
			},
	    	getGoodsspec(item){
	    		if(item.goodsType == 6){
	    			var str = "约" +  Number(item.weighingsmall)*1000 + "~" +  Number(item.weighingbig)*1000
	    			var str2 = "g" + '/' + item.mallUnit;
//	    			console.log(str,str2,9999)
	    			if(str && item.goodsunit && item.mallUnit){
	    				return str + str2;
	    			}else if(item.weighingsmall && item.weighingbig){
	    				return str;
	    			}else{
	    				return ''
	    			}

	    		}else{
	    			return item.goodsSpec || '';
	    		}
	    	},
	    	// getSingerPrice(item){
	    	// 	if(item.goodsType == 6){
	    	// 		var str = '';
	    	// 		if(item.mallUnit){
	    	// 			str = (Number(item.wsprice) * Number(item.weighingbig)).toFixed(2)+'/'+item.mallUnit;
	    	// 		}else{
	    	// 			str = (Number(item.wsprice) * Number(item.weighingbig)).toFixed(2)
	    	// 		}
	    	// 		return str || '';
	    	// 	}else{
	    	// 		let str = Number(item.wsprice).toFixed(2) + '/' + item.goodsunit;
	    	// 		return str || '';
	    	// 	}
			// },
			 getSingerPricely(item){//goodsType == 7  称重散卖 goodsType == 6  称重按个
	    		if(item.goodsType == 6 || item.goodsType == 7){
	    			var str = '';
	    			if(item.mallUnit && item.mallUnit == "斤"){
	    				// str = (Number(item.promSpecPrice) / 2).toFixed(2)+'/500g';
	    				str = (Number(item.promSpecPrice) / 2).toFixed(2);
	    			}else if(item.mallUnit){
	    				str = (Number(item.promSpecPrice) / 2).toFixed(2);
	    			}else{
	    				str = (Number(item.promSpecPrice) / 2).toFixed(2)
	    			}
	    			return str || '';
	    		}else{
					let str;
					if(item.mallUnit){
						// str = Number(item.promSpecPrice).toFixed(2) + '/' + item.mallUnit;
						str = Number(item.promSpecPrice).toFixed(2);
					}else{
						str = Number(item.promSpecPrice).toFixed(2);
					}
	    			
	    			return str || '';
	    		}
			},
			 getSingerPricelys(item){
				//  console.log("123",item)
	    		// if(item.goodsType == 6){
	    		// 	var str = '';
	    		// 	if(item.mallUnit){
	    		// 		str = (Number(item.wsprice) * Number(item.weighingbig)).toFixed(2)+'/'+item.mallUnit;
	    		// 	}else{
	    		// 		str = (Number(item.wsprice) * Number(item.weighingbig)).toFixed(2)
	    		// 	}
	    		// 	return str || '';
	    		// }else{
	    			let str = Number(item.integralprice) + '积分/' + item.mallUnit;
	    			return str || '';
	    		// }
			},
			getSingerPrice(item){//原价小计金额
	    		if(item.buyType == 1){
	    			var str = '';
	    			if(item.mallUnit){
	    				// str = Number(item.promTotalMoney ).toFixed(2);
	    				str = Number(item.totalMoney).toFixed(2);
	    			}else{
	    				// str = Number(item.promTotalMoney ).toFixed(2)
	    				str = Number(item.totalMoney).toFixed(2)
	    			}
	    			return str || '';
	    		}else{
	    			let str = Number(item.totalMoney).toFixed(2);
	    			return str || '';
				}
			},
			getSingerPrices(item){//优惠后的总金额
	    		if(item.buyType == 1){
	    			var str = '';
	    			if(item.mallUnit){
	    				str = Number(item.realTotalMoney).toFixed(2);
	    			}else{
	    				str = Number(item.realTotalMoney).toFixed(2)
	    			}
	    			return str || '';
	    		}else{
	    			let str = Number(item.realTotalMoney ).toFixed(2);
	    			return str || '';
	    		}
			},
			//比较价格
			compareMoney(item){
				let a = 0;
				//  console.log(item,"12345678910",this.getSingerPrices(item),this.getSingerPrice(item),this.getSingerPrices(item) - this.getSingerPrice(item))
				if(this.getSingerPrice(item) - this.getSingerPrices(item) > 0){
					a = 1//原价大于优惠的情况
					// return a;
				}else if(this.getSingerPrice(item) - this.getSingerPrices(item) == 0){
					a = 2;//相等的情况，未参加活动
					// return a;
				}
				console.log("aiqiyi__________________________")
				return a;
			},
			//比较单价
			comparePrice(item){
				let a = 0;
				//   console.log(item,"12345678910____________________--",item.normalprice,this.getSingerPricely(item),item.normalprice - item.promSpecPrice )
				if(item.normalprice - item.promSpecPrice > 0){
					a = 1//原价大于优惠的情况
					// return a;
				}else if(item.normalprice - item.promSpecPrice == 0){
					a = 2;//相等的情况，未参加活动
					// return a;
				}
				console.log("yhouku___________________________++++",a)
				return a;
			},
			// getSingerPriceFood(item){//堂食原价小计金额
	    	// 	if(item.buyType == 1){
	    	// 		var str = '';
	    	// 		if(item.mallUnit){
	    	// 			str = Number(item.totalMoney ).toFixed(2);
	    	// 		}else{
	    	// 			str = Number(item.totalMoney ).toFixed(2)
	    	// 		}
	    	// 		return str || '';
	    	// 	}else{
	    	// 		let str = Number(item.totalMoney ).toFixed(2);
	    	// 		return str || '';
			// 	}
			// },
			// getSingerPricesFood(item){//堂食优惠后的总金额
	    	// 	if(item.buyType == 1){
	    	// 		var str = '';
	    	// 		if(item.mallUnit){
	    	// 			str = Number(item.promTotalMoney).toFixed(2);
	    	// 		}else{
	    	// 			str = Number(item.promTotalMoney).toFixed(2)
	    	// 		}
	    	// 		return str || '';
	    	// 	}else{
	    	// 		let str = Number(item.promTotalMoney ).toFixed(2);
	    	// 		return str || '';
	    	// 	}
			// },
			//比较价格
			// compareMoney(item){
			// 	// console.log("12345678910",this.getSingerPrices(item),this.getSingerPrice(item),this.getSingerPrices(item) - this.getSingerPrice(item))
			// 	if(this.getSingerPrices(item) - this.getSingerPrice(item) < 0){
			// 		return true
			// 	}else{
			// 		return false
			// 	}
			// },
			//比较价格
			compareMoneys(item){
				// console.log("12345678910",this.getSingerPrices(item),this.getSingerPrice(item),this.getSingerPrices(item) - this.getSingerPrice(item))
				if(this.getSingerPrices(item) - this.getSingerPrice(item) === 0){
					return true
				}else{
					return false
				}
			},
			//比较价格堂食
			compareMoneyFood(item){
				// console.log("12345678910",this.getSingerPrices(item),this.getSingerPrice(item),this.getSingerPrices(item) - this.getSingerPrice(item))
				if(this.getSingerPricesFood(item) - this.getSingerPriceFood(item) < 0){
					return true
				}else{
					return false
				}
			},
			//比较价格堂食
			compareMoneysFood(item){
				// console.log("12345678910",this.getSingerPrices(item),this.getSingerPrice(item),this.getSingerPrices(item) - this.getSingerPrice(item))
				if(this.getSingerPricesFood(item) - this.getSingerPriceFood(item) == 0){
					return true
				}else{
					return false
				}
			},
	    	getAdd(item){
	    		if(item.workingInfo){
//	    			return JSON.parse(item.workingInfo).processingattribute
	    			return JSON.parse(item.workingInfo)[0].processingItem
	    		}
	    	},
	    	getDateList(){
	    		this.dataList = this.$route.query.arr;
	    		console.log(this.$route.query.arr,"111222333333333++++-------------------");
//	    		console.log(this.$route.query.obj);
	    		if(this.$route.query.obj){
	    			this.type = this.$route.query.obj.type;
	    			this.flag = this.$route.query.obj.flag;
	    		}
	    	},
	    	goBack(){
	    		window.history.back()
	    	},
	    	goodsImg(goodsItemData) {
	            if (goodsItemData && goodsItemData.urllist) {
	                if(goodsItemData.urllist.length) {
	                	for(let i = 0 ; i < goodsItemData.urllist.length; i++){
	                		if(goodsItemData.urllist[i].Imgurltype == 1){
	                			return goodsItemData.urllist[i].imgurl || "static/image/demo2.png";
	                		}
	                	}
	                } else {
	                    return "static/image/demo2.png";
	                }
	            } else {
	                return "static/image/demo2.png";
	            }
	        },
	        goodsNum(arr) {
	        	console.log(arr,'散卖')
	        	var num = 0;
	        	if(arr && arr.length != 0){
	        		for(let i = 0 ; i < arr.length; i++){
		            	if(arr[i].goodsType == 7){

							num += 1
							console.log(num,'散卖1')
						}else{
							num += arr[i].goodsNum;
							console.log(num,'散卖2')
						}
		            }
	        	}
	        	console.log(num,'散卖2')
	        	return num;
	        },
	        getGoodsSinger(item){
	        	//ladderqty  阶梯重量  minsaleqty 起售重量
	        	if(item.goodsType == 7){
					if(item.goodsNum == 1){
						return Math.round(Number(item.minsaleqty) * 100) / 100;  
					}else{
						var str = item.minsaleqty + (Number(item.goodsNum) - 1) * item.ladderqty;
						return Math.round(Number(str) * 100) / 100; 
					}
	        	}else {
	        		return Math.round(Number(item.goodsNum) * 100) / 100; 
	        	}
			},
			sonPrice(son) {
				// let a = son.goodsUnit == 'kg' ? Number(son.goodsPrice / 2).toFixed(2) : Number(son.totalMoney / son.outGoodsNum).toFixed(2);
				// return a;

				if(item.goodsType == 6 || item.goodsType == 7){
	    			var str = '';
	    			if(item.mallUnit && item.mallUnit == "斤"){
	    				str = (Number(item.realPrice) / 2).toFixed(2)+'/500g';
	    			}else if(item.mallUnit){
	    				str = (Number(item.realPrice) / 2).toFixed(2)+'/500g';
	    			}else{
	    				str = (Number(item.realPrice) / 2).toFixed(2)
	    			}
	    			return str || '';
	    		}else{
					let str;
					str = Number(item.realPrice).toFixed(2) + '/';
	    			return str || '';
	    		}

			},
	    },
		created () {
			this.getDateList();
			this.confirmOrderFoods = this.$router.history.current.query.confirmOrderFood;
			console.log("confirmOrderFoods123",this.confirmOrderFoods)
			console.log("foodShopInformation",this.foodShopInformation)
		},
		mounted () {
			this.goodsNum();
		},
		updated() {

		}
	}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
	.subtotal_list .aui-list-item-media {
	    width: 22vw;
	    height: 22vw;
	}
	.commodity_list .suggest h3 {
	    font-size: 0.7rem;
	    min-height: 1.5rem;
	    max-height: 2.3rem;
		/* overflow: hidden;
        white-space: nowrap;
    	text-overflow: ellipsis; */
	}
	.subtotal {
		/* overflow: hidden;
        white-space: nowrap;
    	text-overflow: ellipsis; */
	}
	.zxmyContent{
		width: 100%;
	    height: 100%;
	    display: flex;
	    flex-direction: column;
	    justify-content: space-between;
	}
    .goodsTopShow{
        opacity: 0.6;
        position: absolute;
        left: 0;top: 0;
        color: #ffffff;
        padding: 0 0.1rem;
        font-size:12px;
    }
    .goodsTopShowBackY{
        background:#faa73c;
    }
    .goodsTopShowBackR{
        background: #EF5423;
	}
	/* .baoguo-root{
		border-bottom: 1px solid #eaeaea;
	}
	.baoguo-title{
		border-bottom: 1px solid #eaeaea;
		border-top: 1px solid #eaeaea;
	} */
	.zxmyContent p{
		color:#000000;
	}
	.zxmyContent h3{
		overflow: hidden;
		-webkit-line-clamp: 2;
		display: -webkit-box;
    	-webkit-box-orient: vertical;
    	overflow: hidden;
	}
	.hzh{
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
		width: 90%;
	}
	.hzhs{
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
		width: 90%;
	}
</style>
